package net.zhangdaqian.lightDom.junitTest;

import static org.junit.Assert.assertEquals;

import net.zhangdaqian.lightDom.LightUrl;

import org.junit.Test;

public class URITest {
	@Test
	public void Urltest() {
		LightUrl u = new LightUrl("http://localhost/1/2/3/4");
		assertEquals("http://localhost/gi", u.merge("/gi"));		
		assertEquals("http://localhost/1/2/3/4/gi", u.merge("./gi"));
		assertEquals("http://localhost/1/2/3/gi", u.merge("../gi"));
		assertEquals("http://localhost/1/2/gi", u.merge("../../gi"));
		assertEquals("http://localhost/1/gi", u.merge("../../../gi"));
		//-----------------------------------------------------
		u.setURI("http://zhangdaqian.net");
		assertEquals("http://zhangdaqian.net/css/sitehome.css", u.merge("css/sitehome.css"));
	}
	@Test
	public void main() {
		LightUrl u = new LightUrl("http://localhost/1/2/3/4");
		u.merge("../gi");
	}

}
